package com.wn.course.repository.module

import com.wn.course.repository.api.CourseService
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import retrofit2.Retrofit
import javax.inject.Singleton

/**
 * @Author: wn
 * @Date: 2023/10/20 16:46
 * @Description: 提供 CourseService 实例
 */
@Module
@InstallIn(SingletonComponent::class)
object ApiModule {
  // 提供 CourseService 实例
  @Singleton
  @Provides
  fun provideStudyAPI(retrofit: Retrofit): CourseService =
    retrofit.create(CourseService::class.java)
}